package com.aaa.hospital.controller;

import com.aaa.hospital.pojo.domain.Manage;
import com.aaa.hospital.pojo.query.ManageQuery;
import com.aaa.hospital.result.AjaxResult;
import com.aaa.hospital.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: HJT
 * @DateTime: 2022/2/21 17:22
 * @Description: TODO
 */
@RestController
@RequestMapping("manage")
public class ManageController {
    @Autowired
    private ManageService manageService;

    @RequestMapping("query")
    public AjaxResult query(ManageQuery manageQuery) {
        return manageService.queryManage(manageQuery);
    }


    @RequestMapping("add")
    public AjaxResult add(Manage manage) {

        return manageService.addManage(manage);
    }

    @RequestMapping("delete/{id}")
    public AjaxResult delete(@PathVariable("id") Integer id) {

        return manageService.deleteManage(id);
    }

    @RequestMapping("get/{id}")
    public AjaxResult get(@PathVariable("id") Integer id) {

        return manageService.getManage(id);
    }

    @RequestMapping("update")
    public AjaxResult update(Manage manage) {

        return manageService.updateManage(manage);
    }
}
